home *** CD-ROM | disk | FTP | other *** search
/ Champak 106 / Vol 106.iso / games / maple_st.swf / scripts / frame_3 / DoAction_12.as < prev    next >
Encoding:
Text File  |  2010-04-12  |  4.4 KB  |  197 lines

  1. function phurtnumshow(string)
  2. {
  3.    _root[hurtshowname]._alpha = 100;
  4.    tempset.text = string;
  5.    if(tempset.text.length == 5)
  6.    {
  7.       _root[hurtshowname].gotoAndStop(5);
  8.       pshow5(tempset.text);
  9.    }
  10.    else if(tempset.text.length == 4)
  11.    {
  12.       _root[hurtshowname].gotoAndStop(4);
  13.       pshow4(tempset.text);
  14.    }
  15.    else if(tempset.text.length == 3)
  16.    {
  17.       _root[hurtshowname].gotoAndStop(3);
  18.       pshow3(tempset.text);
  19.    }
  20.    else if(tempset.text.length == 2)
  21.    {
  22.       _root[hurtshowname].gotoAndStop(2);
  23.       pshow2(tempset.text);
  24.    }
  25.    else if(tempset.text.length == 1)
  26.    {
  27.       _root[hurtshowname].gotoAndStop(1);
  28.       pshow1(tempset.text);
  29.    }
  30. }
  31. function hpde(atkv, atkstyle)
  32. {
  33.    if(_root.playerflash._currentframe == 1)
  34.    {
  35.       _root.playerflash.gotoAndPlay(2);
  36.       _root.player.hurtshow.gotoAndPlay(2);
  37.       atkran = random(20);
  38.       hpd = atkv + atkran;
  39.       var _loc2_ = hpd;
  40.       _loc2_ -= _root.ablities.str * 5;
  41.       if(_root.mapleheroef == true)
  42.       {
  43.          _loc2_ -= Math.round(_root.ablities.str * skill.skillpointarray[6] / 200);
  44.       }
  45.       if(_loc2_ <= 0)
  46.       {
  47.          _loc2_ = 1;
  48.       }
  49.       _root.hp -= _loc2_;
  50.       if(_root.hp <= 0)
  51.       {
  52.          _root.hp = 50;
  53.          _root.atk = false;
  54.          _root.jump = false;
  55.          _root.jumpsct.gotoAndStop(1);
  56.          _root.jumphigh = 0;
  57.          _root.jump = false;
  58.          _root.player._x = 496;
  59.          _root.player._y = 403;
  60.          _root.port = true;
  61.          _root.mapshouldgo = -925;
  62.          _root.gotoAndStop(3);
  63.          expsd();
  64.       }
  65.       vrb += 1;
  66.       duplicateMovieClip(hurtnumshow,"hurtnumshow" + vrb,16384 + vrb);
  67.       hurtshowname = "hurtnumshow" + vrb;
  68.       _root[hurtshowname]._alpha = 100;
  69.       _root[hurtshowname]._x = _root.player._x;
  70.       _root[hurtshowname]._y = _root.player._y - 24;
  71.       _root[hurtshowname].gotoAndStop(5);
  72.       phurtnumshow(_loc2_);
  73.       if(_root.stormskill._currentframe != 1)
  74.       {
  75.          _root.stormskill.gotoAndPlay(29);
  76.       }
  77.    }
  78. }
  79. function pshow5(getstring)
  80. {
  81.    go51 = getstring.charAt(0);
  82.    go52 = getstring.charAt(1);
  83.    go53 = getstring.charAt(2);
  84.    go54 = getstring.charAt(3);
  85.    go55 = getstring.charAt(4);
  86.    if(go51 == 0)
  87.    {
  88.       go51 = 10;
  89.    }
  90.    if(go52 == 0)
  91.    {
  92.       go52 = 10;
  93.    }
  94.    if(go53 == 0)
  95.    {
  96.       go53 = 10;
  97.    }
  98.    if(go54 == 0)
  99.    {
  100.       go54 = 10;
  101.    }
  102.    if(go55 == 0)
  103.    {
  104.       go55 = 10;
  105.    }
  106.    _root[hurtshowname].numshow51.gotoAndStop(go51);
  107.    _root[hurtshowname].numshow52.gotoAndStop(go52);
  108.    _root[hurtshowname].numshow53.gotoAndStop(go53);
  109.    _root[hurtshowname].numshow54.gotoAndStop(go54);
  110.    _root[hurtshowname].numshow55.gotoAndStop(go55);
  111. }
  112. function pshow4(getstring)
  113. {
  114.    go41 = getstring.charAt(0);
  115.    go42 = getstring.charAt(1);
  116.    go43 = getstring.charAt(2);
  117.    go44 = getstring.charAt(3);
  118.    if(go41 == 0)
  119.    {
  120.       go41 = 10;
  121.    }
  122.    if(go42 == 0)
  123.    {
  124.       go42 = 10;
  125.    }
  126.    if(go43 == 0)
  127.    {
  128.       go43 = 10;
  129.    }
  130.    if(go44 == 0)
  131.    {
  132.       go44 = 10;
  133.    }
  134.    _root[hurtshowname].numshow41.gotoAndStop(go41);
  135.    _root[hurtshowname].numshow42.gotoAndStop(go42);
  136.    _root[hurtshowname].numshow43.gotoAndStop(go43);
  137.    _root[hurtshowname].numshow44.gotoAndStop(go44);
  138. }
  139. function pshow3(getstring)
  140. {
  141.    go31 = getstring.charAt(0);
  142.    go32 = getstring.charAt(1);
  143.    go33 = getstring.charAt(2);
  144.    if(go31 == 0)
  145.    {
  146.       go31 = 10;
  147.    }
  148.    if(go32 == 0)
  149.    {
  150.       go32 = 10;
  151.    }
  152.    if(go33 == 0)
  153.    {
  154.       go33 = 10;
  155.    }
  156.    _root[hurtshowname].numshow31.gotoAndStop(go31);
  157.    _root[hurtshowname].numshow32.gotoAndStop(go32);
  158.    _root[hurtshowname].numshow33.gotoAndStop(go33);
  159. }
  160. function pshow2(getstring)
  161. {
  162.    go21 = getstring.charAt(0);
  163.    go22 = getstring.charAt(1);
  164.    if(go21 == 0)
  165.    {
  166.       go21 = 10;
  167.    }
  168.    if(go22 == 0)
  169.    {
  170.       go22 = 10;
  171.    }
  172.    _root[hurtshowname].numshow21.gotoAndStop(go21);
  173.    _root[hurtshowname].numshow22.gotoAndStop(go22);
  174. }
  175. function pshow1(getstring)
  176. {
  177.    go11 = getstring.charAt(0);
  178.    if(go11 == 0)
  179.    {
  180.       go11 = 10;
  181.    }
  182.    _root[hurtshowname].numshow11.gotoAndStop(go11);
  183. }
  184. function expsd()
  185. {
  186.    if(_root.exps / _root.expmax > 0.1)
  187.    {
  188.       _root.exps -= _root.expmax * 0.1;
  189.    }
  190.    else
  191.    {
  192.       _root.exps *= 0.9;
  193.    }
  194.    _root.exps = Math.round(_root.exps);
  195. }
  196. vrb = 0;
  197.